<template>
   <div class="con">
        <div class="header">
            <em><van-icon name="arrow-left" @click="tab1()"/></em>
            <span><van-icon name="wap-home-o" @click="tab2()"/></span>
            <b><van-icon name="cluster-o" @click="share()"/></b>
            <van-action-sheet v-model="show3" title="分享到" height:30>
                <div class="share">
                    <share :config='config'></share>
                </div>
            </van-action-sheet>
        </div>
        <div class="hide-header">
            123
        </div>
        <div class="main">
            <div class="m-pic">
                 <van-swipe :show-indicators='false' indicator-color="white" :height="300">
                 <van-swipe-item ><div class="pic-wrap"><img :src="pimg" alt=""></div></van-swipe-item>
                 </van-swipe>
            </div>
             <div class="price">
                    <div class="p-left">
                        <div class="p-left-left">
                            <van-icon name="friends-o" class="icon1"/>
                            <span>2人起团</span>
                        </div>
                        <div class="p-left-right">
                            <span>￥{{list2.tjprice}}</span>
                            <span>￥{{list2.pprice}}</span>
                            <em></em>
                        </div>
                    </div>
                    <div class="p-right">
                        <span>距结束</span>
                        <van-count-down
                        class="count-time"
                        :time="time"
                         format="DD天HH时mm分ss秒"
                        />
                    </div>
             </div>
             <div class="pname">
                 <em>商城</em>
                 <span>[商城]{{list2.pname}}</span>
             </div>
             <div class="address">
                <van-cell is-link @click="showPopup"  >送至</van-cell>

                <van-popup v-model="show"   position="bottom"
                :style="{ height: '30%' }"><van-area :area-list="areaList" value="110101" @confirm='tab' @cancel='cancel()'/></van-popup>
                <div class="address-con"><span v-for="(item,i) in address" :key='i'>{{item.name}}</span></div>
             </div>

             <div class="content">
                 <p><em><van-icon name="success" class="success"/></em><span>正品保障</span></p>
                 <p><em><van-icon name="success" class="success"/></em><span>商品售出,无质量问题，不接受7天无理由退货</span></p>
                 <p><em><van-icon name="success" class="success"/></em><span>供应商配送</span></p>
             </div>
             <div class="friends">
                 <p>
                     <van-cell class="cell-spec" is-link @click="showPopup1">以下小伙伴正在参与拼团，您可以直接参与</van-cell>

                        <van-popup v-model="show1" class="cell-show">
                            <p>- 以下小伙伴正在参与拼团，您可以直接参与 -</p>
                            <ul>
                     <li>
                         <span class="head-img">1</span>
                         <em>夏及啊</em>
                         <b>
                             <span>4人以参团</span>
                             <span>剩余</span>
                             <span><van-count-down :time="time1" class="p-time"/></span>
                         </b>
                         <i>去参团</i>
                     </li>
                     <li>
                         <span class="head-img"></span>
                         <em>夏及啊</em>
                         <b>
                             <span>4人以参团</span>
                             <span>剩余</span>
                             <span><van-count-down :time="time1" class="p-time"/></span>
                         </b>
                         <i>去参团</i>
                     </li>
                      <li>
                         <span class="head-img"></span>
                         <em>夏及啊</em>
                         <b>
                             <span>4人以参团</span>
                             <span>剩余</span>
                             <span><van-count-down :time="time1" class="p-time"/></span>
                         </b>
                         <i>去参团</i>
                     </li>
                      <li>
                         <span class="head-img"></span>
                         <em>夏及啊</em>
                         <b>
                             <span>4人以参团</span>
                             <span>剩余</span>
                             <span><van-count-down :time="time1" class="p-time"/></span>
                         </b>
                         <i>去参团</i>
                     </li>
                 </ul>
                    
                        </van-popup> 
                </p>
                 <ul>
                     <li>
                         <span class="head-img"></span>
                         <em>夏及啊</em>
                         <b>
                             <span>4人以参团</span>
                             <span>剩余</span>
                             <span><van-count-down :time="time1" class="p-time"/></span>
                         </b>
                         <i>去参团</i>
                     </li>
                     <li>
                         <span class="head-img"></span>
                         <em>夏及啊</em>
                         <b>
                             <span>4人以参团</span>
                             <span>剩余</span>
                             <span><van-count-down :time="time1" class="p-time"/></span>
                         </b>
                         <i>去参团</i>
                     </li>
                 </ul>
             </div>

             <div class="palymethods">
                 <h2>拼团玩法</h2>
                 <ul>
                     <li>
                         <van-icon name="like-o" />
                         <span>选择心仪商品</span>
                         <em></em>
                     </li>
                     <li>
                         <van-icon name="coupon-o" />
                         <span>支付开团或开团</span>
                         <em></em>
                     </li>
                     <li>
                         <van-icon name="friends-o" />
                         <span>等待好友参团支付</span>
                         <em></em>
                     </li>
                     <li>
                         <van-icon name="flag-o" />
                         <span>达到人数团购成功</span>
                     </li>
                 </ul>
             </div>
             <div class="basic-par">
                 <h2>基本参数</h2>
                 <ul>
                     <li>
                         <span>商品名称:</span>
                         <p>外婆桥 紫菜50克*3包(圆形)</p>
                     </li>
                     <li>
                         <span>主品1:</span>
                         <p>外婆桥 紫菜50克*3包</p>
                     </li>
                     <li>
                         <span>产地1:</span>
                         <p>中国:浙江省:台州市</p>
                     </li>
                     <li>
                         <span>规格:</span>
                         <p>50g/袋</p>
                     </li>
                     <li>
                         <span>重量/净含量:</span>
                         <p>50g*3袋</p>
                     </li>
                      <li>
                         <span>容器,包装的形态及材质:</span>
                         <p>供应商包装</p>
                     </li>
                 </ul>
             </div>
             
        </div>
       <footer>
           <div class="footer-left">
               <van-icon name="star-o" @click="tab4()"/>
               <span>拼团首页</span>
           </div>
           <div class="footer-right">
               <p><span>￥{{list2.tjprice}}</span> <span>￥{{list2.pprice}}</span></p>
               <p>我要开团</p>
           </div>
       </footer>
   </div>
</template>

<script>
import * as api from '../../api/getproductlist';
import {mapState,mapGetters,mapActions,mapMutations} from 'vuex'
export default {
    name:'Goass',
    computed:{
          ...mapState(['areaList','config']),
    },
     data() {
    return {
      time:30*60*60*1000,
      checked:true,
       show: false,
       list2:{},
       show1:false,
       show2:false,
       show3:false,
       pimg:'',
       time1:60*60*1000,
        actions: [
        { name: '选项' },
        { name: '选项' },
        { name: '选项', subname: '描述信息' }
      ],
       address:'',
    }
  },
  methods:{
        showPopup() {
      this.show = true;
    },
      showPopup1() {
      this.show1 = true;
    },
     onSelect(item) {
      // 默认情况下，点击选项时不会自动关闭菜单
      // 可以通过 close-on-click-action 属性开启自动关闭
      Toast(item.name);
    },
    tab(data){
        this.address=data;
      this.show = false;

    },
    cancel(){
      this.show = false;

    },
    tab1(){
        this.$router.go(-1)
    },
    tab2(){
        this.$router.push('/index')
    },
    share(){
            this.show3=true
        },
     tab4(){
        this.$router.push('/assemble')
    }
    
  },
  mounted(){
        api.getproinfo({pid:this.$route.params.id}).then(data=>{
            this.list2=data.data.data
            this.pimg=this.list2.pimg
        })
  }


  
    
}

   
</script>

<style scoped>
.social-share{
    display: flex;
    justify-content: space-between;
    padding: 0 38px
}
.share{
    height: 100px;
}
.hide-header{
      height: 46px;
    display: flex;
    align-items: center;
    padding: 0 18px;
    padding-top: 18px;
    background: pink ;
    width: 100%;
    display: none
}
.more{
    display: flex;
    align-items: center;
    color: #000;
    font-size: 12px
}
.arrow{
    margin-left: 3px;
    color: #999999;
    font-size: 14px
}
.friends{
    background: #fff;
    margin-top: 8px;
    padding: 0 18px;
    padding-right: 0
}
.friends ul li{
    display: flex;
    align-items: center;
    height: 80px;
}
.friends ul li em{
    font-size: 14px;
    margin-right: 60px
}
.friends ul li b{
    display: flex;
    flex-direction: column;
    align-items: flex-end
}
.friends ul li b span{
    color:#a7a7a7; 
    font-weight: normal;
}
.cell-spec{
    padding-left: 0;
    font-size: 13px
}
.p-time{
    color:#a7a7a7;
    font-weight: normal;  
}
.friends ul li b span:first-child{
    font-weight: normal;
    display: block;
    height: 20px;
    line-height: 20px;
    font-size: 14px;
    color: #000;
}
.cell-show{
    width: 355px;
    height: 550px;
    background: #fff
}

.friends ul li i{
    display: block;
    width: 80px;
    height: 30px;
    border-radius: 15px;
    text-align: center;
    line-height: 30px;
    margin-left: 12px;
    background:#f9821a;
    color: #fff
}
.head-img{
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: block;
    border: 1px solid red;
    margin-right: 30px;
    background: url('https://pics4.baidu.com/feed/48540923dd54564e8138e2e314c02a87d0584faa.png?token=e5c18d1e7d91d7d6279faa69deb39b28&s=34800CFA14113E714C35452C0300500A')
}
.friends em,i{
    font-style: normal;
}

.friends p{
    line-height:35px;
    display: flex;
    justify-content: space-between;
    color: #1b1b1b;
    padding-right: 5px;
    margin-bottom: 7px
}
.cell-show p{
    padding-left: 50px;
    font-size: 13px
}
.basic-par{
    margin-top: 8px;
    background: #fff;
    padding:0 18px;
    height: 280px;
}
.basic-par ul li{
    display: flex;
    height: 40px;
    align-items: top
    
}
.basic-par ul li span{
    color:#7f7f7f;
    display: block;
    width:60px;
    margin-right: 25px
}

.basic-par h2{
    height: 30px;
    line-height: 30px;
    font-size:14px ;
    margin-top: 10px;
    margin-bottom: 8px;
    font-weight: normal;
}
.palymethods{
    background: #fff;
    margin-top: 8px;
    padding-left: 18px;
    padding-bottom: 15px;
    overflow: hidden;
}
.palymethods h2{
    height: 30px;
    line-height: 30px;
    font-weight: normal;
    font-size: 14px;
    margin-top: 10px;
    margin-bottom: 10px;
}
.palymethods  ul{
    display: flex
}
.palymethods  ul li{
    width: 25%;
    display: flex;
    align-items: center;
    position: relative;
}
.palymethods  ul li em{
    position: absolute;
    width: 18px;
    height: 11px;
    left: 70px;
    background: url(../assets/p4.gif) center/cover
}
.palymethods  ul li span{
    width: 50px;
    display: block;
    margin-left: 7px
}
.content{
    margin-top: 5px;
    background: #fff;
    padding-left: 18px;
    padding-top: 5px
}
.success{
    margin-top: 2px
}
.content p{
    display: flex;
    height: 30px;
    line-height: 30px;
    align-items: center
}
.content em{
    width: 13px;
    height: 13px;
    border: 1px solid red;
    border-radius: 50%;
    line-height: 13px;
    text-align: center;
    color: red;
    display: block;
    margin-right: 7px
}
.content span{
    font-size: 12px;

    color: #a8a8a8
}
.address{
    position: relative;
}
.address-con{
    position: absolute;
    top: 13px;
    margin: auto;
    left: 20%;
    font-size: 12px
}
.con{
    height: 100vh;
    display: flex;
    flex-direction: column
}
.main{
    flex: 1;
    overflow: auto;
    background:#f3f3f3; 
}
footer{
    height: 50px;
    display: flex
}
.footer-left{
    width: 15%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #7f7f7f;
    font-size: 8px

}
.footer-left .star{
   font-size: 12px
}
.footer-right{
    width: 85%;
    background: #f95118;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff
}
.p-left-right em{
    position: absolute;
    width: 20px;
    height: 1px;
    background: #7f7f7f;
    top: 27px;
    display: block;
    left: 2px
}
.footer-right span:nth-of-type(1){
    font-size: 14px
}
.footer-right span:nth-of-type(2){
    color:#ffbfbf;
    font-size: 10px
}
    

.pname{
    height: 60px;
    line-height: 60px;
    display: flex;
    align-items: center;
    padding-left: 18px;
    border-bottom: 1px solid #f3f3f3;
    background: #fff
}
.pname em{
    display: block;
    width: 40px;
    height: 18px;
    background:#d81c25;
    line-height:18px;
    text-align: center;
    color: #fff ;
    font-style: normal;
    font-size: 10px;
    margin-right: 10px
}
.pname span{
    font-size: 14px
}
.icon1{
    font-size: 16px
}
.p-left{
    display: flex
}
.p-right span{
    color: #fff;
    font-size: 
}
.count-time{
    color: #fff;
    font-size: 12px;
    margin-top:3px ;
}
.p-left-right{
    position: relative;
    display: flex;
    flex-direction: column;
}
.p-left-right span{
    color: #fff
}
.p-left-right span:first-child{
    font-size: 14px;
    font-weight: 350;
}
.p-left-right span:last-child{
    font-size: 10px;
    color:#ffbfbf;

}
.p-left-left{
    border: 1px solid red;
    width: 70px;
    height: 20px;
    background: #fff;
    border-radius: 15px;
    color:#f84717;
    text-align: center;
    line-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 5px;
    margin-right: 3px;
    
}


p,h2,h3{
    margin: 0;
}
.header{
    height: 46px;
    display: flex;
    align-items: center;
    padding: 0 18px;
    padding-top: 10px
}
.header em{
    display: block;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    line-height: 35px;
    text-align: center;
    background: #cccccc;
    color: #fff;
    font-style:normal;
    font-size: 20px
}
.header em{
    margin-right: 230px;
    display: block;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    line-height: 35px;
    text-align: center;
    background: #cccccc;
    color: #fff;
    font-style:normal;
    font-size: 20px

}
.header b{
      display: block;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    line-height: 35px;
    text-align: center;
    background: #cccccc;
    color: #fff;
    font-style:normal;
    font-size: 20px

}
.header span{
    margin-right: 10px;
    display: block;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    line-height: 35px;
    text-align: center;
    background: #cccccc;
    color: #fff;
    font-style:normal;
    font-size: 20px

}
.main .price{
    height: 50px;
    background: #f95b18;
    display: flex;
    align-items: center;
    padding:0 5px;
    justify-content: space-between;
    padding-left: 18px
}
.pic-wrap{
    width:100%;
    height: 300px;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    margin: auto;
    overflow:hidden;
}
.m-pic img{
  width: 100%;
  height: 100%;
}
.m-pic .van-swipe-item:first-of-type{
   background: #fff;
   position: relative;
}

</style>